// Created by carolsail
import ViewBase from '../xf/ViewBase';
import LData from '../manager/LData';
import PrefabManager from '../xf/manager/PrefabManager';
import SoundManager from '../manager/SoundManager';
import SoundPath from '../struct/SoundPath';
import MdGame from './MdGame';
import MdHome from './MdHome';
import AndroidTool from './AndroidTool';

const { ccclass, property } = cc._decorator;

@ccclass
export default class MdPause extends ViewBase {


    private static _inst:MdPause;

    public static get inst()
    {
        if(this._inst==null  || this._inst.node==null)
        {
            let v=cc.instantiate(PrefabManager.getPrefab("PauseView"));

            this._inst=v.getComponent(MdPause);
        }

        return this._inst;
    }

    public showView(data?: any): void {
        super.showView(data)
        if(cc.sys.platform==cc.sys.ANDROID){
            AndroidTool.Instance.onPauseViewShow()
        }
    }

    public hideView(): void {
        if(cc.sys.platform==cc.sys.ANDROID){
            AndroidTool.Instance.onPauseViewHide()
        }
        super.hideView()
    }

    onHome()
    {
          this.hideView();

        //   MdHome.inst.showView();
        cc.director.loadScene("Main",()=>{
        });
    }


    onJiXu()
    {
        MdGame.inst.pause_flag=false;

        this.hideView();
    }

}
